﻿
using System.Collections.Generic;
using MiniWeb.Core.Dtos;
using MiniWeb.Core.Entities;
using MiniWeb.Dao;
using MiniWeb.Core.Entities;
using WFramework.MvcPager;

namespace MiniWeb.Task
{
    public class NewsTask
    {
        private readonly NewsDao _dao = new NewsDao();

        public PagedList<NewsDto> GetPagedList(int? rid, int? tid, bool? isHot, string newstitle, int pageIndex, int pageSize)
        {
            return _dao.GetPagedList(rid, tid, isHot, newstitle, pageIndex, pageSize);
        }


      

        public List<NewsDto> GetGongLvList(int top)
        {
            return _dao.GetGongLvList(top);
        }

        public News GetById(int id)
        {
            return _dao.GetById(id);
        }

        public void Delete(int id)
        {

            _dao.Delete(id);
        }


        public bool Exists(int id)
        {

            return _dao.Exists(id);
        }

        public void Add(News model)
        {

            _dao.Add(model);
        }

        public void Update(News model)
        {

            _dao.Update(model);
        }

        public List<News> GetAll(int? top, string strwhere)
        {
            return _dao.GetAll(top, strwhere);
        }

        public News GetCModel(int cid)
        {
            return _dao.GetCModel(cid);
        }



    }
}